<!DOCTYPE html>
<html lang="en">
<!--header-->
<include file="Public:header"/>
<!--header-->
<section id="main-content">
    <section class="wrapper">
        <h3><i class="fa fa-angle-right"></i> 添加/修改公司信息</h3>

        <!-- BASIC FORM ELELEMNTS -->
        <div class="row mt">
            <div class="col-lg-12">
                <div class="form-panel">
                    <h4 class="mb"><i class="fa fa-angle-right"></i> 公司信息
                        <a class="btn btn-theme btn-default" href="{:U('xie')}">返回</a>
                    </h4>
                    <form id="type" class="form-horizontal style-form" method="post" action=""  enctype="multipart/form-data">
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">协议类型</label>
                            <div class="col-sm-10">
                                <select  id="status" name="status" class="form-control">
                                    <!-- <option value="1" <if condition="$list['status'] == 1">selected </if>>支付说明</option>-->
                                      <option value="2" <if condition="$list['status'] == 2">selected</if>>积分说明</option>
                                    <option value="3" <if condition="$list['status'] == 3">selected</if>>转介规则</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">协议内容</label>
                            <div class="col-sm-10">
                                <textarea id="content" name="content" class="input">{$list.content}</textarea>
                            </div>
                        </div>

                        <input type="hidden" id="id" name="id" value="{$list.id}">
                        <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label"></label>
                            <div class="col-sm-10">
                                <input  type="button" id="tianjia" class="btn btn-theme" value="保存" style="width: 150px;margin-left: 60px">
                                <input  type="reset" class="btn btn-warning" value="重置" style="width: 150px">
                            </div>
                        </div>
                    </form>
                </div>
            </div><!-- col-lg-12-->
        </div><!-- /row -->
    </section>
</section>
<!--footer-->
<include file="Public:footer"/>
<!--footer-->
<script type="text/javascript" src="__PUBLIC__/ui/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__PUBLIC__/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="__PUBLIC__/kindeditor/lang/zh_CN.js"></script>
<script>
    //编辑器
    var editor;
    KindEditor.ready(function(e){
        editor = e.create("[name=content]",{
            "width":"700px",
            "height":"300px",
            allowFileManager:true, //允许对上传图片进行管理
            "items":["source", "|", "undo", "redo", "|", "preview","|", "justifyleft", "justifycenter", "justifyright", "justifyfull", "insertorderedlist", "insertunorderedlist", "indent", "outdent", "subscript", "superscript", "clearhtml","|","formatblock", "fontname", "fontsize", "|", "forecolor", "hilitecolor", "bold", "italic", "underline","|", "image"]
        });
    });
    $("#tianjia").click(function(){
        editor.sync();
        var status     = $("#status").val();
        var content   = $("#content").val();
        if($("#id").val()){
            var id = $("#id").val();
        }else{
            var id = 0;
        }
        $.ajax({
            type:"post",
            data:{status:status,content:content,id:id},
            url:"{:U('xie_add')}",
            success:function (res) {
                if(res.status == 1){
                    layer.open({
                        title: '分类添加/修改提示：',content: res.info
                    });
                }
                if(res.status == 2){
                    layer.open({
                        title: '分类添加/修改提示：',content: res.info
                    });
                }
            }
        })
    });

</script>

</body>
</html>
